package VacationTest.PlaneFight.src;

import javax.swing.*;
import java.awt.*;
import java.util.Vector;

public class bullet {

    public int x;
    public int y;
    protected int width=30;
    protected int height=40;
    protected int speed = 15;

    public Image img = new ImageIcon("E:\\JavaCode\\AirWar\\src\\VacationTest\\PlaneFight\\Image\\bullet2.png").getImage();

    public bullet(int x,int y){
        this.x = x;
        this.y = y;
    }
    private volatile static Vector<bullet> bullets ;



    public static Vector<bullet> getSingleton() {
        if (bullets == null) {
            synchronized (bullet.class) {
                if (bullets == null) {
                    bullets = new Vector<bullet>();
                }
            }
        }
        return bullets;
    }
    public void addBullets(bullet e){
        bullets.add(new bullet(x,y));
    }
}